
<!DOCTYPE html>
<html lang="en-US">
<head>
    <meta charset="UTF-8"/>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=1" name="viewport" />
    <meta http-equiv="content-script-type" content="text/javascript">
    <meta name="format-detection" content="telephone=no" />
    <!-- uc强制竖屏 -->
    <meta name="screen-orientation" content="portrait">
    <!-- QQ强制竖屏 -->
    <meta name="x5-orientation" content="portrait">
            <link rel="shortcut icon" href="/favicon.ico">
            <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
        <meta http-equiv="Pragma" content="no-cache" />
        <meta http-equiv="Expires" content="0" />
    <title>我的余额</title>
    <link rel="stylesheet"href="statics/mobile/css/style.css?v=201708115933363455">
    <link rel="stylesheet"href="statics/mobile/css/SpsBtn.css?v=201708115933363455">
    <link rel="stylesheet"href="statics/mobile/css/User/regularmembers.css?v=201708115933363455">
    
</head>

<body style="width:100%;">


<div class="membersbox pad50">

  <section class="fall-back"><a href="/User/mycoupon/sid/4001109.html?pid=27020622">我的余额</a></section>
  <section class="cashitem">
      <div class="Integral J_pay" style="width:100px;height:100px;"><p>余额</p><p style="font-size:28px;height:35px;"><?php echo  floatval($customer_count['amount']);?></p><p style="font-size:14px;">充值</p></div>
      <ul>
          <li><p>已提现：<strong>¥<?php echo floatval($customer_count['withdraw_amount']);?></strong></p></li>
          <li><p>冻结余额：<strong>¥<?php echo  floatval($customer_count['wait_amount']);?></strong></p></li>
      </ul>
      <div class="change_record" style="display: block;">
          <table>
              <thead>
                  <tr>
                      <td>原因</td>
					  <td>收/支</td>
                      <td>余额</td>
                      <td>时间</td>
                  </tr>
              </thead>
              <tbody id="J-changeRecord">
				  <tr><td colspan="4">暂无数据</td></tr>
              </tbody>
          </table>
          <!-- load more start-->
          <div class="staticLoading">
              <p>
                  <span class="staticLoading-icon" style="display:none;"></span>
                  <span class="j-loading-text loading-border">加载更多</span>
              </p>
          </div>
      </div>

  </section>
  <script type="text/j-template" id="tpl_item_order_lists">
    <% _.each(dataset,function(item){ %>
	<tr>
	  <td><%= item.content %></td>
	  <td><%= item.amount %></td>
	  <td><%= item.end_amount %></td>
	  <td><%= item.updatetime %></td>
	</tr>
    <% }) %>
</script>

  <?php include VIEWS_PATH."bottom.php";?>
  <b id="htmlReplace-navCart"></b>
</div>

<?php include VIEWS_PATH."footer.php";?>

<script>
$(document).on("click", ".J_pay", function() {
  var order_id = $(this).data("order");
  var i = {
    title: "选择支付方式"
  },
  l = $("#J-pay").html(),
  s = _.template(l, i),
  c = $(s);
  r=50;
  0 == $(".addurl_con").length && $("body").append(c), $(".addurl_con").css("top", r), $(".addurl_con").animate({
    top: "50px"
  }, 500, function() {
    $(".J-call").click(function() {
      $(".addurl_con").remove()
    }),
    $(".J-okPay").click(function() {
      var pay_type = $('.pay_active').data('val');
      var amount=$("#pay_amount").val();
      if(pay_type=="3"){
        window.location.href="?con=pay&act=wxpay&type=JSAPI&pay_type=charge&amount="+amount;
      }
      else if(pay_type=="1"){
        window.location.href="?con=pay&act=alipay&type=JSAPI&pay_type=charge&amount="+amount;
      }
    });
  });
})
$(document).on("touchstart", ".pay_item", function() {
  $(".pay_item").removeClass('pay_active');
  $(this).addClass('pay_active');
});
function loadData() {
	a.find(".staticLoading-icon").show();
	if(load==false){
		$.ajax({
			url: "?con=user&act=balance",
			type: "POST",
			dataType: "json",
			data: {
				commit:1,
				p:page
			},
			success: function(result) {
				if (result && result.status=="1") {
					t=result.data;
					for(i in t){
						t[i].updatetime=new Date(parseInt(t[i].updatetime)*1000).toLocaleString();
					}
					var o = _.template(e, {
						dataset: t
					}),
					s = $(o);
					if(page==0){
						n.html(s);
					} else {
						n.append(s);
					}
					a.find(".staticLoading-icon").hide();
					if(!t.length || t.length < 6){
						a.find(".j-loading-text").text("暂无更多数据");
						a.data('stop','1');
					} else {
						a.find(".j-loading-text").text("点击查看更多");
						a.data('stop','0');
					}
					page++;
				}
			}
		})
	}
}
var page=0,
load=false,
a = $("#j-staticLoading");
e = $("#tpl_item_order_lists").html();
n = $("#J-changeRecord");
loadData();
$("#j-staticLoading").click(function(){
	if($(this).data('stop')!='1'){
		loadData();
	}
});
</script>
<!-- end -->
</body>
</html>
<!-- 20170105 -->
